Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

odata: handle invalid skiptokens #1278

Merged
merged 8 commits into from
Dec 7, 2024

Conversation

alxndrsn
Copy link
Contributor

@alxndrsn alxndrsn commented Nov 8, 2024

@alxndrsn alxndrsn changed the title Unparsable skiptoken odata: handle invalid skiptokens Nov 25, 2024
@alxndrsn
Copy link
Contributor Author

Unit test failures without changes to lib/:


  943 passing (7s)
  1 pending
  9 failing

  1) odata message composition
       single submission output
         metadata generation
           with $skiptoken
             should throw error for malformed $skiptoken 'nonsense':
     AssertionError: expected [Promise] to be rejected of type Problem, but got Error
      at next$onError (node_modules/should/cjs/should.js:1799:14)

  2) odata message composition
       single submission output
         metadata generation
           with $skiptoken
             should throw error for malformed $skiptoken 'eyJyZXBlYXRJZCI6ImNmOWExYjVjYzgzYzZkNjI3MGMxZWI5ODg2MGQyOTRlYWM1ZDUyNmQifQ==':
     AssertionError: expected [Promise] to be rejected of type Problem, but got Error
      at next$onError (node_modules/should/cjs/should.js:1799:14)

  3) odata message composition
       single submission output
         metadata generation
           with $skiptoken
             should throw error for malformed $skiptoken '00eyJyZXBlYXRJZCI6ImNmOWExYjVjYzgzYzZkNjI3MGMxZWI5ODg2MGQyOTRlYWM1ZDUyNmQifQ==':
     AssertionError: expected [Promise] to be rejected
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at /home/user/workspaces/odk/backend/node_modules/should/cjs/should.js:1747:16

  4) odata message composition
       single submission output
         metadata generation
           with $skiptoken
             should throw error for malformed $skiptoken '02eyJyZXBlYXRJZCI6ImNmOWExYjVjYzgzYzZkNjI3MGMxZWI5ODg2MGQyOTRlYWM1ZDUyNmQifQ==':
     AssertionError: expected [Promise] to be rejected
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at /home/user/workspaces/odk/backend/node_modules/should/cjs/should.js:1747:16

  5) odata message composition
       single submission output
         metadata generation
           with $skiptoken
             should throw error for malformed $skiptoken '01':
     AssertionError: expected [Promise] to be rejected of type Problem, but got SyntaxError
      at next$onError (node_modules/should/cjs/should.js:1799:14)

  6) odata message composition
       single submission output
         metadata generation
           with $skiptoken
             should throw error for malformed $skiptoken '01aGk=':
     AssertionError: expected [Promise] to be rejected of type Problem, but got SyntaxError
      at next$onError (node_modules/should/cjs/should.js:1799:14)

  7) odata message composition
       single submission output
         metadata generation
           with $skiptoken
             should throw error for malformed $skiptoken '01e30=':
     AssertionError: expected [Promise] to be rejected: expected Error {
  problemCode: 400.34,
  problemDetails: undefined,
  message: 'Record associated with the provided $skiptoken not found.'
} to match Object { problemCode: 400.35, message: 'Invalid $skiptoken' }
    not matched properties: problemCode (400.34), message ('Record associated with the provided $skiptoken not found.')
      at next$onError (node_modules/should/cjs/should.js:1799:14)

  8) odata message composition
       single submission output
         metadata generation
           with $skiptoken
             should throw error for malformed $skiptoken '01IiI=':
     AssertionError: expected [Promise] to be rejected
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at /home/user/workspaces/odk/backend/node_modules/should/cjs/should.js:1747:16

  9) odata message composition
       single submission output
         metadata generation
           with $skiptoken
             should throw error for malformed $skiptoken '01~':
     AssertionError: expected [Promise] to be rejected of type Problem, but got Error
      at next$onError (node_modules/should/cjs/should.js:1799:14)

@alxndrsn alxndrsn marked this pull request as ready for review November 25, 2024 11:52
@matthew-white
Copy link
Member

I'll let @sadiqkhoja take a look at this one!

@matthew-white matthew-white removed their request for review November 25, 2024 15:51
@alxndrsn alxndrsn merged commit 38fd622 into getodk:master Dec 7, 2024
1 check passed
@alxndrsn alxndrsn deleted the unparsable-skiptoken branch December 7, 2024 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unparseable $skiptoken behaviour is undefined
3 participants